<template>
    <div class='app-content login-page'>
        <img :src="topBg" alt="" class="background"/>
        <div class="login-title">来访登记</div>
        <div class="app-view">
            <van-form @submit="onSubmit">
                <van-field
                    v-model="username"
                    name="用户名"
                    :border="false"
                    autocomplete="off"
                    placeholder="请输入用户名"
                >
                    <template #left-icon>
                        <i class="iconfont icon-yonghu"></i>
                    </template>
                </van-field>
                <van-field
                    v-model="password"
                    type="password"
                    name="密码"
                    :border="false"
                    autocomplete="new-password"
                    placeholder="请输入登录密码"
                >
                    <template #left-icon>
                        <i class="iconfont icon-ziyuanxhdpi"></i>
                    </template>
                </van-field>
                <van-button round block type="info" native-type="submit">登录</van-button>
            </van-form>
        </div>
        <div class="bottom-logo">
            <img class="logo" :src="logo"/>
            <div class="power">Powered by 首创置业</div>
        </div>
    </div>
</template>

<script>
import {mapGetters} from "vuex"
export default {
    name: '',
    data() { 
        return {
            logo:require('@/assets/images/logo.png')
        }
    },
    computed:{
        ...mapGetters(['themeClass']),
        topBg(){
            let image = require('@/style/theme/images/login-bg.png');
            //根据不同的主题，切换不同的顶部背景图片
            if(this.themeClass != 'theme-DEFAULT'){
                image = require('@/style/theme/images/login-bg.png');
            }
            return image
        }
    },
    props: {

    },
    components:{
    },
    mounted() {

    },
    methods:{
        onSubmit(){
            this.$router.push({
                path:"/index"
            })
        }
    },
}
</script>

<style lang='scss' scoped>
.login-page{
    padding-left:1.2rem;
    padding-right:1.2rem;
    .background{
        position:fixed;
        width:100%;
        height:auto;
        left:0;
        top:0;
        z-index: 1;
    }
    .login-title{
        position:relative;
        z-index: 2;
        font-size:0.6rem;
        line-height: 1;
        padding-top:6.3rem;
        padding-bottom:0.7rem;
        text-align: center;
        color:#fff;
    }
    .app-view{
        position:relative;
        z-index: 2;
        padding:1.7rem 0;
        .van-form{
            width:7.5rem;
            margin:0 auto;
            .van-cell{
                line-height: 1.1rem;
                border-radius: 100px;
                border:1px solid #ededed;
                padding-top:0;
                padding-bottom:0;
                padding-left:0.4rem;
                padding-right:0.4rem;
                /deep/.van-field__left-icon{
                    margin-right:0.3rem;
                    color:#999999;
                }
                /deep/.van-field__control{
                    box-shadow: inset 100px 100px #fff;
                }
            }
            .van-cell+.van-cell{
                margin-top:0.3rem;
            }
            .van-button{
                margin-top:1.2rem;
                height:1.1rem;
                font-size:0.4rem;
            }
        }
    }
}
.bottom-logo{
    position:fixed;
    bottom:0.6rem;
    left:50%;
    transform: translateX(-50%);
    text-align: center;
    .logo{
        display:block;
        margin:0 auto;
        width:2.3rem;
        height:auto;
    }
    .power{
        font-size:0.28rem;
        color:#999999;
        line-height: 1;
        margin-top:0.3rem;
        white-space: nowrap;
    }
}
</style>